package org.huihoo.orbas.rtutil.threadpool;

import java.util.Comparator;

/**
 * <p>
 * Title:
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Copyright: Copyright (c) 2002
 * </p>
 * <p>
 * Company: Huihoo Power! http://www.huihoo.com
 * </p>
 * 
 * @author not attributable
 * @version 1.0
 */

public class LaneAscendingComparator implements Comparator {
	public LaneAscendingComparator() {
	}

	public int compare(Object o1, Object o2) {
		if (!(o1 instanceof ThreadLane) || !(o2 instanceof ThreadLane)) {
			throw new IllegalArgumentException(
					"Argument variable must be ThreadLane instance.");
		}
		//
		ThreadLane _o1 = (ThreadLane) o1;
		ThreadLane _o2 = (ThreadLane) o2;
		//
		return _o1.getPriority() - _o2.getPriority();
	}

	public boolean equals(Object obj) {
		/** @todo Implement this java.util.Comparator method */
		throw new java.lang.UnsupportedOperationException(
				"Method equals() not yet implemented.");
	}

}